home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / a_utils / perl / perl5.ann < prev    next >
Internet Message Format  |  1993-08-14  |  4KB

  1. From comp.lang.perl Mon Aug  2 10:18:20 1993
  2. Newsgroups: comp.lang.perl
  3. Path: ruuinf!sun4nl!mcsun!uunet!europa.eng.gtefsd.com!wx.gtegsc.com!news.cerf.net!netlabs!lwall
  4. From: lwall@netlabs.com (Larry Wall)
  5. Subject: Perl 5 alpha available
  6. Message-ID: <1993Jul31.094219.23063@netlabs.com>
  7. Sender: news@netlabs.com
  8. Nntp-Posting-Host: scalpel.netlabs.com
  9. Organization: NetLabs, Inc.
  10. Date: Sat, 31 Jul 1993 09:42:19 GMT
  11. Lines: 138
  12.  
  13. I've put a tar of my current Perl 5 directory onto ftp.netlabs.com,
  14. in pub/outgoing/perl5.0/perl5a1.tar.Z.
  15.  
  16. Now's your chance to check out all the bugs I said I fixed in Perl 5.  :-)
  17.  
  18. Before you get all twitterpated, this is unsupported "alpha 1" code.
  19. There is no Configure, only a makefile.  It will probably only work on
  20. a Sun4.  The compiler and interpreter are still very much unoptimized
  21. (though it already runs as fast or faster than Perl 4).  It doesn't do
  22. everything that I want it to yet.  It doesn't have the OO stuff yet.
  23. It doesn't have "my" yet (though it's got the innards for it).  It
  24. doesn't have a debugger.
  25.  
  26. But it does have references, and you can play with them.  All the
  27. regression tests pass.  For your befuddlement, here's the op/ref.t test:
  28. ----------------------------------------------------
  29. #!./perl
  30.  
  31. print "1..24\n";
  32.  
  33. $bar = "ok 1\n";
  34. $foo = "ok 2\n";
  35. {
  36.     local(*foo) = *bar;
  37.     print $foo;
  38. }
  39. print $foo;
  40.  
  41. $baz = "ok 3\n";
  42. $foo = "ok 4\n";
  43. {
  44.     local(*foo) = 'baz';
  45.     print $foo;
  46. }
  47. print $foo;
  48.  
  49. $foo = "ok 6\n";
  50. {
  51.     local(*foo);
  52.     print $foo;
  53.     $foo = "ok 5\n";
  54.     print $foo;
  55. }
  56. print $foo;
  57.  
  58. $baz = "ok 7\n";
  59. $bar = 'baz';
  60. $foo = 'bar';
  61. print $$$foo;
  62.  
  63. $BAZ = "ok 8\n";
  64. $BAR = \$BAZ;
  65. $FOO = \$BAR;
  66. print $$$FOO;
  67.  
  68. @ary = (9,10,11,12);
  69. $ref[0] = \@a;
  70. $ref[1] = \@b;
  71. $ref[2] = \@c;
  72. $ref[3] = \@d;
  73. for $i (3,1,2,0) {
  74.     push(@{$ref[$i]}, "ok $ary[$i]\n");
  75. }
  76. print @a;
  77. print ${$ref[1]}[0];
  78. print @{$ref[2]}[0];
  79. print @{'d'};
  80.  
  81. $refref = \\$x;
  82. $x = "ok 13\n";
  83. print $$$refref;
  84.  
  85. $ref = [[],2,[3,4,5,]];
  86. print scalar @$ref == 3 ? "ok 14\n" : "not ok 14\n";
  87. print $$ref[1] == 2 ? "ok 15\n" : "not ok 15\n";
  88. print ${$$ref[2]}[2] == 5 ? "ok 16\n" : "not ok 16\n";
  89. print scalar @{$$ref[0]} == 0 ? "ok 17\n" : "not ok 17\n";
  90.  
  91. print $ref->[1] == 2 ? "ok 18\n" : "not ok 18\n";
  92. print $ref->[2]->[0] == 3 ? "ok 19\n" : "not ok 18\n";
  93.  
  94. $refref = \%whatever;
  95. $refref->{"key"} = $ref;
  96. print $refref->{"key"}->[2]->[0] == 3 ? "ok 20\n" : "not ok 20\n";
  97.  
  98. $spring[5]->[0] = 123;
  99. $spring[5]->[1] = 456;
  100. push(@{$spring[5]}, 789);
  101. print join(':',@{$spring[5]}) eq "123:456:789" ? "ok 21\n" : "not ok 21\n";
  102.  
  103. @{$spring2{"foo"}} = (1,2,3);
  104. $spring2{"foo"}->[3] = 4;
  105. print join(':',@{$spring2{"foo"}}) eq "1:2:3:4" ? "ok 22\n" : "not ok 22\n";
  106.  
  107. sub mysub { print "ok 23\n" }
  108. $subref = \&mysub;
  109. &$subref;
  110.  
  111. $subrefref = \\&mysub2;
  112. &$$subrefref("ok 24\n");
  113. sub mysub2 { print shift }
  114. --------------------------------------------------------------
  115. All that gobbledygook works, believe it or not.  For fun, run it through
  116. perl -Dxst.
  117.  
  118. I smell some new JAPHs coming...
  119.  
  120. I don't want to get stuck "supporting" this, but if you want to run your
  121. favorite scripts past it and see which ones toss their salad, you may.
  122. If you can come up with a decent bug report with a small test case, I'll
  123. certainly be glad to look at it.  I'm not really interested in obscure
  124. core dumps at the moment.  I'm still getting plenty of those on my own.
  125.  
  126. I'm not yet interested in memory leak reports either.
  127.  
  128. I can tell you that no program that uses the old autoloading
  129. mechanism will run, since there is no visibility into the
  130. symbol table pointers currently.  You ought to be able to redefine
  131. a subroutine while it's running, though.  (I haven't tested that in
  132. several months, however.  There oughta be a regression test for that...)
  133.  
  134. Don't bother trying to diff Perl 4 with Perl 5.  Everything is different.
  135. All names have been regularized.  Here's a key, if you're brave and
  136. want to peek at the sources:
  137.  
  138.     SV    scalar value
  139.     AV    array value
  140.     HV    hash value
  141.     GV    glob value
  142.     CV    code value
  143.     RV    reference value
  144.     PV    pointer value
  145.     NV    numeric value
  146.     IV    integer value
  147.  
  148. I'm going to be in New Jersey next week, so don't expect quick replies.
  149.  
  150. Larry
  151.  
  152.